home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Viewers / aa_m68k_Intel_Only / ToyViewer1.2 / Source / pcx2pxo.tproj / pcx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-08  |  824 b   |  33 lines

  1. /*
  2.     pcx.h
  3.         partially based on "pcxtoppm.c" by Michael Davidson (1990).
  4.  
  5.     Ver.1.0   1995-05-02  T.Ogihara
  6. */
  7.  
  8. #include  <stdio.h>
  9. #include  <libc.h>
  10. #include  <objc/objc.h>
  11. #include  "../common.h"
  12.  
  13. #define     pcxMAGIC    0x0a    /* Magic number */
  14. #define     sizeof_pcxHeader  128
  15. #define     hasPALETTE    0x0c
  16. #define  numPALETTE    256
  17.  
  18. typedef struct {
  19.     unsigned short    x, y;
  20.     unsigned char    version, comp;       /* version, compression */
  21.     unsigned char    bits;    /* 1: 8dots/byte  4: 2dots/byte  8: 1dot/byte */
  22.     unsigned char    planes;    /* Number of planes */
  23.     short    xbytes;        /* bytes/line */
  24.     short    xpm, ypm;    /* ratio x:y */
  25.     short    pinfo;        /* palette info. */
  26.     paltype    *palette;
  27.     unsigned char    memo[MAX_COMMENT];
  28. } pcxHeader;
  29.  
  30. pcxHeader *loadPcxHeader(FILE *, int *);
  31. void freePcxHeader(pcxHeader *);
  32. int pcxGetImage(FILE *, FILE *, pcxHeader *);
  33.